package cz.proks.bank.client;

import java.util.List;

import javax.xml.ws.WebServiceException;

import cz.cvut.felk.support.aos.sw.clearingcenter.ClearingCenter;
import cz.cvut.felk.support.aos.sw.clearingcenter.ClearingCenterImplService;
import cz.cvut.felk.support.aos.sw.clearingcenter.FetchPaymentsFaultException_Exception;
import cz.cvut.felk.support.aos.sw.clearingcenter.GetPaymentsResultFaultException_Exception;
import cz.cvut.felk.support.aos.sw.clearingcenter.Payment;
import cz.cvut.felk.support.aos.sw.clearingcenter.RegisterFaultException_Exception;
import cz.cvut.felk.support.aos.sw.clearingcenter.SendPaymentsFaultException_Exception;
import cz.cvut.felk.support.aos.sw.clearingcenter.SetPaymentsResultFaultException_Exception;

public class ClearingCenterClient implements ClearingCenter {
	private final ClearingCenter clearingCenter;
	
	public ClearingCenterClient() throws WebServiceException {
		ClearingCenterImplService ss = new ClearingCenterImplService();        
		clearingCenter = ss.getClearingCenterImplPort();
	}

	public List<Payment> getPaymentsResult(String bankKey, List<Long> paymentIds)
			throws GetPaymentsResultFaultException_Exception {
		return clearingCenter.getPaymentsResult(bankKey, paymentIds);
	}

	public void setPaymentsResult(String bankKey,
			List<Payment> paymentsWithResults)
			throws SetPaymentsResultFaultException_Exception {
		clearingCenter.setPaymentsResult(bankKey, paymentsWithResults);
	}

	public List<Payment> fetchPayments(String bankKey)
			throws FetchPaymentsFaultException_Exception {
		return clearingCenter.fetchPayments(bankKey);
	}

	public List<Long> sendPayments(String bankKey, List<Payment> payments)
			throws SendPaymentsFaultException_Exception {
		return clearingCenter.sendPayments(bankKey, payments);
	}

	public String register(String bankCode)
			throws RegisterFaultException_Exception {
		return clearingCenter.register(bankCode);
	}

	
}
